import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import vueJsx from '@vitejs/plugin-vue-jsx'
import vueSetupExtend from 'vite-plugin-vue-setup-extend'
import path from 'path'
// https://vitejs.dev/config/
export default defineConfig({
  plugins: [
    vueSetupExtend(),
    vue({
      reactivityTransform: true
    }),
    vueJsx()
  ],
  resolve: {
    alias: {
      '@': path.resolve(__dirname, './src')
    }
  },
  css: {
    preprocessorOptions: {
      less: {
        additionalData: `
          @import "@/assets/styles/variables.less";
          @import "@/assets/styles/mixins.less";
        `
      }
    }
  },
  server: {
    port: 8080, // 运行的端口号
    host: "www.corho.com", // 运行的域名
    open: true, // 自动打开浏览器
    cors: true, // 允许开发时 ajax 跨域
  }
})
